<include file="Public/HOME/HTML/head_html_5.html" />
<meta charset="utf-8" />
<title>{$title}{$Think.const.TITLE}</title>
<include file="Public/HOME/HTML/CssAndJs.html" />
<include file="Public/HOME/HTML/middle_list.html" />
<div class="container-fluid main-content">
	<div class="row">
		<div class="col-md-12">
			<div class="widget-container fluid-height clearfix">
				<div class="heading">
					<i class="icon-tags"></i>项目详情
				</div>
				<div class="col-md-3" style="margin: 20px 0 0 20px">
					 <div
						class="item widget-container fluid-height profile-widget isotope-item">
						<div class="item widget-container fluid-height profile-widget">
							<div class="widget-content padded">
								<div class="profile-info clearfix">
									<img width="70" height="70" class="social-avatar pull-left"
										src="{$Think.const.RESOURCES}UPLOADS/photo/{$cinfo.photo}"
										style="margin: 0 20px 0 0; border-radius: 70px" />
									<div class="profile-details" style="margin: 10px 0 10px 0">
										<a class="user-name" href="#"><strong>{$cinfo.sname}</strong></a>
										<p style="margin: 10px 0 10px 0">
											<i class="icon-map-marker"></i> {$cinfo.place}
										</p>
										<p style="margin: 5px 10px 10px 90px; font-size: 13px";line-height:22px>
											<strong>主讲老师：</strong>{$cinfo.majorteacher}
										</p>
									</div>
								</div>
							</div>
						</div>
					</div> 
				</div>
				
				
				<div class="col-md-8" style="margin: 0 0 40px 20px">
					<p style="font-size: 24px; color: #007aff; font-family: 微软雅黑, 宋体;">
						{$cinfo.scname}</p><input value="{$Think.session.userUid}" id="uid" hidden="">
					<div class="blog-content" style="float: left">
						<div class="11" style="margin: 15px 0 5px 0">
							<blockquote>
								<address>
									<span class="meta-author" style="color: #f09606;">所属专题：{$cinfo.sname}</span>&nbsp;&nbsp;
									<span class="meta-author" style="color: #f09606;">开始时间：{$cinfo.startdate}</span>&nbsp;&nbsp;
									<span class="meta-author" style="color: #f09606;">结束时间：{$cinfo.enddate}</span>&nbsp;&nbsp;
									<span class="meta-author" style="color: #f09606;">上课地点：{$cinfo.place}</span>
								</address>
							</blockquote>
						</div>
						<div class="as" style="margin: 0 0 0 10px">
							<span class="meta-author"
								style="font-weight: bold; color: #1EA6E9;">课程内容：</span>
							{$cinfo.content|htmlspecialchars_decode|stripslashes}
						</div>
						</br> 
					
						<div class="as" style="margin: 0 0 0 10px">
							<span class="meta-author"
								  style="color: #1EA6E9; font-weight: bold;">课程结果：</span>
							{$cinfo.result|htmlspecialchars_decode|stripslashes}
						</div>
					
						<blockquote style="margin: 50px 0 0 0; color: #f09606;">
							<address>
								<span class="meta-author" style="color: red; font-size: 20px">课程票数：总{$cinfo.totalticket}||剩<span id="restticket">{$cinfo.restticket}</span></span>&nbsp;</br>
								<span class="meta-author" style="color: #468847;">发布时间：{$cinfo.scdate}</span>&nbsp;</br>
								<span class="meta-author" style="color: #468847;"> <a
									    href="{$Think.const.DOMAIN_NAME}Home/Special/download/scid/{$cinfo.scid}">附件(可下载)：{$cinfo.attach|substr=###,9,30}</a>
								</span>&nbsp;</br>
								

								<if condition="$cinfo.statue eq '0' AND $cinfo.restticket neq '0'"> <a
									id="qiang"
									class="label label-primary"
									style="margin: 0 0 0 0; float: right; font-size: 18px; font-family: 微软雅黑；">&nbsp;  抢课  &nbsp;</a>
								   <elseif condition="$cinfo.statue eq '1'"/> <span class="label label-warning"
									style="margin: 0 0 0 0; float: right; font-size: 18px; font-family: 微软雅黑；">&nbsp;开课中,不能取消&nbsp;</span>
									<elseif condition="$cinfo.statue eq '2'"/> <span class="label label-warning"
									style="margin: 0 0 0 0; float: right; font-size: 18px; font-family: 微软雅黑；">&nbsp;课程结束&nbsp;</span>
								</if>
								  <a
									id="cancel"
									class="label label-primary"
									style="margin: 0 0 0 0; float: right; font-size: 18px; font-family: 微软雅黑;display:none">&nbsp;  取消课程  &nbsp;</a>


							</address>
						</blockquote>
						<!-- /.blog-content -->
				</cinfolist>
				<!-- /.post-blog -->
			</div>
		</div>
	</div>
</div>
</div>
</div>
</div>
<include file="Public/HOME/HTML/footer.html" />
	<script type="text/javascript">
						var uid=$("#uid").val();
						var scid={$cinfo.scid};
						// alert(uid);
                        //判断是否已经被用户抢到票
						 $.ajax({
					            type:"get",
					            url:"__CONTROLLER__/estimate/uid/"+uid+"/scid/"+scid,
					            success:function(data){
					            	// alert(data);
					              if(data=='false') {
					                $("#qiang").hide();
					                $("#cancel").show();
					              }
						            else{
						            	 $("#qiang").show();
					               		 $("#cancel").hide();
						            }
						        }
					          });
						 //抢票
						$("#qiang").click(function(){
							if(uid){
							 $.ajax({
					            type:"get",
					            url:"__CONTROLLER__/cjoin/uid/"+uid+"/scid/"+scid,
					            success:function(data){
					              if(data) {
					                alert("抢票成功");
					                $("#restticket").text(data);
					                $("#qiang").hide();
					                $("#cancel").show();
					              }
					              else if(data=='false'){
									alert("已抢票");
						            }
						            else{
						            	alert("抢票失败");
						            }
						        }
					          });
							}
							else{
							alert("请登录后投票");
							// var data="courseLogin"
							$.get("__CONTROLLER__/set_session/scid/"+scid);
							window.location.href = "{$Think.const.DOMAIN_NAME}Home/Account/Login";
								
									
							}

						});
						//取消预订的课程
						$("#cancel").click(function(){
							if(uid){
							 $.ajax({
					            type:"get",
					            url:"__CONTROLLER__/cancelCourse/uid/"+uid+"/scid/"+scid,
					            success:function(data){
					            	 // alert(data);
					              if(data) {
					              	alert("取消成功");
					              	$("#restticket").text(data);
					                $("#qiang").show();
					                $("#cancel").hide();
					              }
						            else{
						            	alert("取消失败");
						            }
						        }
					          });
							}
							else{
							alert("请登录后投票");
							$.get("__CONTROLLER__/set_session/scid/"+scid);
							window.location.href = "{$Think.const.DOMAIN_NAME}Home/Account/Login"; 
							}
						});
						</script>
</body>
</html>